import * as proxy from '../proxy';
import ServiceBase from '../base';

const GET_JOB = '/jobs';

class JobService extends ServiceBase {
    createJob = (options) => {
        let promise = super.post({
            url: GET_JOB,
            data: options,
        });
        return proxy.httpResultProxy(promise);
    };

    getJob = (options) => {
        let promise = super.get({
            url: GET_JOB + `?urn=${options.urn}`,
        });
        return proxy.httpResultProxy(promise);
    };

    getBatchJob = (options) => {
        let promise = super.post({
            url: GET_JOB + `/batchget`,
            data: options,
        });
        return proxy.httpResultProxy(promise);
    };
}

export { JobService };
